.cg-wrap {
  box-sizing: content-box;
  position: relative;
  display: block;
}

/* tooltip board in seek table */
.cg-wrap.minitooltip {
  width: 200px;
}

cg-container {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  top: 0;
  right: 0;
}

cg-board {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  line-height: 0;
  background-size: cover;
  cursor: pointer;
}
cg-board square {
  position: absolute;
  top: 0;
  left: 0;
  width: 11.11%;
  height: 10%;
  pointer-events: none;
}

.cg-wrap piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 11.11%;
  height: 10%;
  background-size: cover;
  z-index: 2;
  will-change: transform;
  pointer-events: none;
}
.blindfold piece {
  opacity: 0;
  position: relative;
}

cg-board piece.dragging {
  cursor: move;
  z-index: 9;
}

piece.anim {
  z-index: 8;
}

piece.fading {
  z-index: 1;
  opacity: 0.5;
}

.cg-wrap piece.ghost {
  opacity: 0.3;
}

.cg-wrap piece svg {
  overflow: hidden;
  position: relative;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

.cg-wrap cg-auto-pieces,
.cg-wrap .cg-shapes,
.cg-wrap .cg-custom-svgs {
  overflow: hidden;
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cg-wrap cg-auto-pieces {
  z-index: 2;
}

.cg-wrap cg-auto-pieces piece {
  opacity: 0.3;
}

.cg-wrap .cg-shapes {
  overflow: hidden;
  opacity: 0.6;
  z-index: 2;
}

.cg-wrap .cg-custom-svgs {
  /* over piece.anim = 8, but under piece.dragging = 10 */
  z-index: 9;
}

.cg-wrap .cg-custom-svgs svg {
  overflow: visible;
}

.cg-wrap coords {
  position: absolute;
  display: flex;
  pointer-events: none;
  opacity: 0.8;
  font-size: 0.85em;
  font-weight: bold;
}
/* hide coords */
@media (max-width: 799px) and (orientation: portrait) {
  .cg-wrap coords {
    display: none;
  }
}
.cg-wrap coords.side {
  right: var(--ranks-right);
  top: var(--ranks-top);
  height: 100%;
  width: 12px;
}
.cg-wrap coords.side.forward, .cg-wrap coords.side.backward.black {
  flex-flow: column-reverse;
}
.cg-wrap coords.side.backward, .cg-wrap coords.side.forward.black {
  flex-flow: column;
}
.cg-wrap coords.bottom {
  bottom: -1rem;
  left: 0;
  width: 100%;
  height: 16px;
  text-align: center;
}
.cg-wrap coords.top {
  top: -1.3rem;
  left: 0;
  width: 100%;
  height: 16px;
  text-align: center;
}
.cg-wrap coords.bottom.forward, .cg-wrap coords.bottom.backward.black, .cg-wrap coords.top.forward, .cg-wrap coords.top.backward.black {
  flex-flow: row;
}
.cg-wrap coords.bottom.backward, .cg-wrap coords.bottom.forward.black, .cg-wrap coords.top.backward, .cg-wrap coords.top.forward.black {
  flex-flow: row-reverse;
}
.cg-wrap coords coord {
  flex: 1 1 auto;
}
@media (min-width: 800px) and (min-height: 500px) {
  .cg-wrap coords.side coord {
    transform: translateY(39%);
  }
}
